import Layout from "@/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";
import Demo from "@/views/demo/index.vue";
import ImportExcel from "@/views/importExcel/index.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "root",
    component: Layout,
    redirect: { name: "ImportExcel" },
    children: [
      {
        path: "importExcel",
        name: "ImportExcel",
        component: ImportExcel,
        meta: {
          title: "主页",
        },
      },
      {
        path: "tools",
        name: "Tools",
        component: () => import("@/views/tools/index.vue"),
        meta: {
          title: "工具",
        },
      },
      {
        path: "about",
        name: "About",
        component: () => import("@/views/about/index.vue"),
        meta: {
          title: "关于",
          noCache: true,
        },
      },
    ],
  },
  {
    path: "/tpLinkVideo",
    name: "TpLinkVideo",
    component: () => import("@/views/tpLinkVideo/index.vue"),
    meta: {
      title: "录像回放",
      noCache: true,
    },
  },
  {
    path: "/importExcel",
    name: "ImportExcel",
    component: () => import("@/views/importExcel/index.vue"),
    meta: {
      title: "导入Excel",
      noCache: true,
    },
  }
];

export default routes;
